﻿<Cmdlet(VerbsLifecycle.Complete, "SqlTransaction")>
Public Class CompleteSqlTransaction
    Inherits PSCmdlet

    <Parameter>
    Public Property ConnectionName As String = "Default"

    Protected Overrides Sub EndProcessing()
        MyBase.EndProcessing()

        If Not DBInfo.Connections.ContainsKey(Me.ConnectionName) Then
            WriteWarning(DBInfo.NoConnection(Me.ConnectionName))
            Exit Sub
        End If

        DBInfo.Connections(Me.ConnectionName).CommitTransaction()
    End Sub
End Class
